window.onload = function () {
    //获取所有的tr元素
    var trs = document.getElementsByClassName("myTr");
    //
    for (var i = 0; i < trs.length; i++) {
        trs[i].onmouseover = function () {
            this.style.backgroundColor = "yellow";}
        trs[i].onmouseout = function () {
            this.style.backgroundColor = "";}
    }
}